﻿namespace CabinetGrid.DeviceDriver.Dtos;

public partial class RFIDUHFTagDto
{
    [JsonProperty( "id" )]
    public string Id { get; set; }

    [JsonProperty( "reader" )]
    public string Reader { get; set; }

    [JsonProperty( "pc" )]
    public string PC { get; set; }

    [JsonProperty( "epc" )]
    public string EPC { get; set; }

    [JsonProperty( "tid" )]
    public string TID { get; set; }
}

partial class RFIDUHFTagDto
{
    [JsonProperty( "ants" )]
    public List<AntInfo> AntList { get; set; }

    [JsonProperty( "scan_count" )]
    public long ScanCount => this.AntList.Sum( i => i.Count );
}

partial class RFIDUHFTagDto
{
    public class AntInfo
    {
        [JsonProperty( "no" )]
        public int AntNo { get; set; }

        [JsonProperty( "rssi" )]
        public int RSSI { get; set; }

        [JsonProperty( "count" )]
        public long Count { get; set; }
    }
}